home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagg_m.zip / ISR.SWG / 0005_ISRINFO.PAS.pas < prev    next >
Pascal/Delphi Source File  |  1993-05-28  |  2KB  |  42 lines

  1. { What is an ISR?? Are there several things you have to know to create
  2.  one in Pascal?? Thanks.
  3.  
  4.         ISR stands For interrupt service routine (I think; Hey, I
  5.         just remember the abbriveation) :) But what it does is
  6.         changes an interrupt vector to the address of a routine
  7.         of yours then, your routine calls the actual interrupt code.
  8.  
  9.         In the next message, I'll post some heavily commented code
  10.         that is a time TSR, But what is a TSR? Just a resident
  11.         ISR. (By the way, The TSR screws up Blue Wave when resident)
  12.  
  13.         ---=== Extremely simplified version of how an ISR works ===---
  14.  
  15.         Assuming you know what an interrupt is (You called it a hardware
  16.         command) ... When you call an interrupt (TP: Intr, Asm: int) the
  17.         CPU stops what its doing and calls up a routine at a certain
  18.         memory address (Which is called the interrupt's vector). You
  19.         can get the address of the routine by using GETinTVEC. Now
  20.         if you have this code
  21. }
  22.           Uses Dos;
  23.           Var
  24.              the_inTERRUPT: Procedure;
  25.           begin
  26.              getintvec (--Interrupt num--, @the_inTERRUPT);
  27.           end.
  28. {
  29.         it will store the vector of the interrupt into @the_interrupt
  30.         (if you dont know what a Pointer is, go back to the manual and
  31.         read the section on them)
  32.         So, Everytime you call the_inTERRUPT it will actually call what
  33.         ever interrupt you made the_interrupt point to. on the same
  34.         note SETinTVEC (--int num--, @your_Routine) will set it where
  35.         when ever you call that interrupt it will execute your routine.
  36.  
  37.         What the ISR does is gets the vector of the interrupt you
  38.         want to 'Latch' onto, puts it into a Procedure (As shown
  39.         above) then, Uses SETinTVEC to set the ISR routine inside
  40.         that interrupt. The ISR routine then calls the Procedure
  41.         that points to the old interrupt.
  42. }